const productDao = require('../dao/productDao');
module.exports.find = async function(searchObj,page){
    try{
        return await productDao.find(searchObj,page);
    }catch(e){
        
        return {};
    }
}
module.exports.findAll = async function(){
    try{
        return await productDao.findAll();
    }catch(e){
        
        return {};
    }
}
module.exports.findById = async function(id){
    try{
        return await productDao.findById(id);
    }catch(e){
        return {};
    }
}
module.exports.insert = async function(products){
   
    try{
        return await productDao.insert(products);
    }catch(e){
        return {}
    }
}
module.exports.update = async function(id,products){
    try{
        return await productDao.update(id,products);
    }catch(e){
        return {}
    }
}
module.exports.delete = async function(id){
    try{
        return await productDao.delete(id);
    }catch(e){
        return {}
    }
}